package com.breeze.leetcode.util;

import com.breeze.leetcode.exception.DatasetException;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.List;

/**
 * 读取数据集
 * @author yangzh
 * @date 2025/2/27
 */
public class DatasetUtils {

    public static List<char[][]> read(String path) {
        File directory = new File(path);
        if (!directory.exists() || !directory.isDirectory()) {
            throw new DatasetException(path + " is not a directory");
        }

        File[] files = directory.listFiles((dir, name) -> name.endsWith(".json"));
        assert files != null;

        for (File file : files) {
            try {
                FileReader reader = new FileReader(file);

            } catch (FileNotFoundException e) {
                throw new RuntimeException(e);
            }
        }

        return null;
    }
}
